package com.hosp.vo;

import java.util.List;

import com.github.pagehelper.PageInfo;
import lombok.Data;

/**
 * 封装的响应结果集
 *
 * @author bing.zhang06@hand-china.com 2021/9/11 10:36
 **/
@Data
public class ResultVO<T> {
    /**
     * 分页集合
     */
    private PageInfo<T> pageInfo;
    /**
     * 不分页集合对象
     */
    private List<T> list;
    /**
     * 不分页对象
     */
    private T obj;
    /**
     * 表示返回的状态码
     */
    private Integer code = 200;
    /**
     * 表示可以展示给用户的信息
     */
    private String msg = "success";


    public ResultVO() {
    }

    public ResultVO(PageInfo<T> pageInfo) {
        this.pageInfo = pageInfo;
    }

    public ResultVO(List<T> list) {
        this.list = list;
    }

    public ResultVO(T obj) {
        this.obj = obj;
    }

    public ResultVO(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
